<?php


namespace App\Models\MainDB;
use \Illuminate\Database\Eloquent\Model;

class WeekStar extends Model
{
    protected $table = 'ln_week_star';     //数据库内完整表名

    protected $primaryKey = 'id';    //主键名
    public $timestamps = false;

    protected $fillable = [
        'id',               //主键id
        'gift_id_1',        //礼物1
        'gift_id_2',        //礼物2
        'weeks',            //第几周
        'period',           //第几期
        'create_time',      //添加时间
        'update_time',
        'status',           //1进行中2未开始
        'deleted',          //0未删除1已删除
        'room_types',
    ];

    public function gift_data1() {
        return $this->hasOne('App\Models\MainDB\Gift', 'id', 'gift_id_1');
    }
    public function gift_data2() {
        return $this->hasOne('App\Models\MainDB\Gift', 'id', 'gift_id_2');
    }
}
